<?php
/*
 * 快递公司业务类
 */
class Application_Model_shipType extends Application_Model_DomainObject{
    
    protected $_id;//序号

	protected $_name;//名称
	
	protected $_comment;//备注
	
    protected  $_image;//公司图标

    protected $_code;//编码

    protected $_isUrl;//是否查询结果是URL,;//API接口是否只能拿出查询地址
    
    protected $_type;//类型.0国际快递,1国内快递
    
    protected $_word;//名称首字母,用于做索引

    protected $_disabled;//是否失效
    

    /**
	 * 返回数据持久化对象
	 * @return Application_Model_StoreItem
	 */
	private static function getDb(){
		return new Application_Model_DbTable_shipType();
	}

        /*
         * 获取所有快递公司列表
         */
	public static function getAll(){
            
            $result=Application_Model_shipType::getDb()->getAll();
            return $result;
                
	}
        
        /*
         * 
         */
	public static function getbyType($type){            
            $result=Application_Model_shipType::getDb()->getbyType($type);
            return $result;
                
	}
    
    /**
     * 根据编码返回一个快递公司
     * @param type $code
     * @return Application_Model_shipType 
     */
    public static function getByCode($code){
        return Application_Model_shipType::getDao()->queryOne(array('code'=>$code));
    }
    
    public static function getByWord($word){
        return Application_Model_shipType::getDao()->queryAll(array('word'=>$word));
    }
    public static function getByName($lname){
        return Application_Model_shipType::getDao()->queryOne(array("name"=>$lname));
    }
}
?>
